<?php

require_once 'phpmoko/ui/Widget.php';

class ScrollPanel extends Widget
{
	/**
	 * @var Widget
	 */
	private $widget;

	function __construct($widget)
	{
		parent::__construct();
		$this->widget = $widget;
	}

	function toString()
	{
		$str = '<div style="overflow: auto; position: relative;';

		if ($this->getWidth() != null)
			$str .= ' width: '.$this->getWidth().';';

		if ($this->getHeight() != null)
			$str .= ' height: '.$this->getHeight().';';

		$str .= '">';

		$str .= $this->widget->toString();

		$str .= '</div>';

		return $str;
	}
}
?>